unit RUltimaPosicao;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, RLReport, RLPreviewForm;

type
  TFormRUltimaPosicao = class(TForm)
    RLReport1: TRLReport;
    RLBand1: TRLBand;
    RLSystemInfo1: TRLSystemInfo;
    RLGroup1: TRLGroup;
    RLBand2: TRLBand;
    RLBand3: TRLBand;
    RLLabel2: TRLLabel;
    RLLabel5: TRLLabel;
    RLLabel6: TRLLabel;
    RLLabel7: TRLLabel;
    RLLabel8: TRLLabel;
    RLLabel9: TRLLabel;
    RLLabel10: TRLLabel;
    RLLabel12: TRLLabel;
    RLDBText1: TRLDBText;
    RLDBText2: TRLDBText;
    RLDBText3: TRLDBText;
    RLDBText4: TRLDBText;
    RLDBText5: TRLDBText;
    RLDBText6: TRLDBText;
    RLDBText8: TRLDBText;
    RLDBText9: TRLDBText;
    RLImage1: TRLImage;
    RLImage2: TRLImage;
    RLLabel1: TRLLabel;
    RLDBText7: TRLDBText;
    procedure RLDBText4BeforePrint(Sender: TObject; var Text: String;
      var PrintIt: Boolean);
    procedure RLBand1BeforePrint(Sender: TObject; var PrintIt: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
    CaminhoLogo : String;
  end;

var
  FormRUltimaPosicao: TFormRUltimaPosicao;

implementation

uses DMR, Geral, DMS, SendMailOptions;

{$R *.dfm}

procedure TFormRUltimaPosicao.RLDBText4BeforePrint(Sender: TObject;
  var Text: String; var PrintIt: Boolean);
begin
    Text := FormataFone(Text);
end;

procedure TFormRUltimaPosicao.RLBand1BeforePrint(Sender: TObject;
  var PrintIt: Boolean);
begin
    DMSr.dsEmpresaProp.DataSet.Open;
    if (GetParametro('LOGO') <> '') and ((pos('BMP',UpperCase(GetParametro('LOGO'))) > 0) or (pos('JPG',UpperCase(GetParametro('LOGO'))) > 0))then
        RLImage1.Picture.LoadFromFile(GetParametro('LOGO'));
    if (CaminhoLogo <> '0') and ((pos('BMP',UpperCase(CaminhoLogo)) > 0) or (pos('JPG',UpperCase(CaminhoLogo)) > 0))then
        RLImage2.Picture.LoadFromFile(CaminhoLogo);
end;

end.
